package com.woniuxy.handler;

import com.woniuxy.exception.CustomException;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.io.FileNotFoundException;

//这是异常处理的父类
public class MyExceptionHandler {
    @ExceptionHandler({Exception.class})
    public String handler(Exception exception) {
        if (exception instanceof CustomException) {
            //....
        } else if (exception instanceof FileNotFoundException) {
            //....
        }

        return "";
    }
}
